export function getOperationName(operationEnum,operationEnumItem){
  if(operationEnumItem==operationEnum.ADD_NODE) return "添加节点";
  else if(operationEnumItem==operationEnum.EDIT_NODE) return "编辑节点";
  else if(operationEnumItem==operationEnum.DELETE_NODE) return "删除节点";
  else if(operationEnumItem==operationEnum.ADD_LINK) return "添加连接";
  else if(operationEnumItem==operationEnum.EDIT_LINK) return "编辑连接";
  else if(operationEnumItem==operationEnum.DELETE_LINK) return "删除连接";
  else if(operationEnumItem==operationEnum.ADD_TYPE) return "添加类型";
  else if(operationEnumItem==operationEnum.EDIT_TYPE) return "编辑类型";
  else if(operationEnumItem==operationEnum.DELETE_TYPE) return "删除类型";
  else return "未知操作";
}

export function getDisplayLabel(operationEnum,historyItem){
  let operationEnumItem = historyItem.operation;
  if(operationEnumItem==operationEnum.ADD_NODE) return historyItem.newObj.label;
  else if(operationEnumItem==operationEnum.EDIT_NODE) return historyItem.oldObj.label;
  else if(operationEnumItem==operationEnum.DELETE_NODE) return historyItem.oldObj.label;
  else if(operationEnumItem==operationEnum.ADD_LINK) return historyItem.newObj.predicate;
  else if(operationEnumItem==operationEnum.EDIT_LINK) return historyItem.oldObj.predicate;
  else if(operationEnumItem==operationEnum.DELETE_LINK) return historyItem.oldObj.predicate;
  else if(operationEnumItem==operationEnum.ADD_TYPE) return historyItem.newObj.name;
  else if(operationEnumItem==operationEnum.EDIT_TYPE) return historyItem.oldObj.name;
  else if(operationEnumItem==operationEnum.DELETE_TYPE) return historyItem.oldObj.name;
  return "error";
}

export function getDisplayIcon(operationEnum,historyItem) {
  let operationEnumItem = historyItem.operation;
  if(operationEnumItem==operationEnum.ADD_NODE) return "el-icon-circle-plus-outline";
  else if(operationEnumItem==operationEnum.EDIT_NODE) return "el-icon-edit";
  else if(operationEnumItem==operationEnum.DELETE_NODE) return "el-icon-remove-outline";
  else if(operationEnumItem==operationEnum.ADD_LINK) return "el-icon-circle-plus-outline";
  else if(operationEnumItem==operationEnum.EDIT_LINK) return "el-icon-edit";
  else if(operationEnumItem==operationEnum.DELETE_LINK) return "el-icon-remove-outline";
  else if(operationEnumItem==operationEnum.ADD_TYPE) return "el-icon-circle-plus-outline";
  else if(operationEnumItem==operationEnum.EDIT_TYPE) return "el-icon-edit";
  else if(operationEnumItem==operationEnum.DELETE_TYPE) return "el-icon-remove-outline";
  return "error";
}